package com.renfei.multimediatask.ui.task5;

import android.opengl.GLSurfaceView;
import android.os.Bundle;

import com.renfei.multimediatask.R;
import com.renfei.multimediatask.base.BaseActivity;
import com.renfei.multimediatask.util.OpenGlUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

public class OpenGLDrawTriangleActivity extends BaseActivity {

    @BindView(R.id.glSurfaceView)
    GLSurfaceView glSurfaceView;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_open_g_l_draw_triangle;
    }

    @Override
    protected void initListener() {

        if (!OpenGlUtils.isSupportGL20(this)){

            showToast("当前设备不支持OpenGL ES 2.0");
        }else {


            glSurfaceView.setEGLContextClientVersion(2);
            glSurfaceView.setRenderer(new TriangleRender(this));
            glSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
        }
    }

}
